package ants.bot;

import java.util.HashSet;

import ants.map.Coordinate;

public class Orders {

	/**
	 * key=from, value=to
	 */
	private final HashSet<Coordinate> ordersFrom = new HashSet<Coordinate>();
	private final HashSet<Coordinate> ordersTo = new HashSet<Coordinate>();

	public void addOrder(Coordinate from, Coordinate to) {
		if (from != null)
			ordersFrom.add(from);
		if (to != null)
			ordersTo.add(to);
	}

	public void clear() {
		ordersFrom.clear();
		ordersTo.clear();
	}

	public boolean hasOrderFrom(Coordinate from) {
		return ordersFrom.contains(from);
	}

	public boolean hasOrderTo(Coordinate to) {
		return ordersTo.contains(to);
	}

}
